package com.daka.service.impl;

import com.daka.dao.GroupMapper;
import com.daka.entity.Group;
import com.daka.entity.Volunteer;
import com.daka.service.GroupService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author beliveli on 2016/3/31 0031.
 */
@Service("groupService")
@SuppressWarnings("unused")
public class GroupServiceImpl implements GroupService {

    @Resource(name = "groupMapper")
    private GroupMapper groupMapper;

    public Group selectById(int id) {
        return groupMapper.selectById(id);
    }

    public List<Volunteer> selectVolById(int id) {
        return groupMapper.selectVolById(id);
    }

    public List<Group> selectAll() {
        return groupMapper.selectAll();
    }

    @Override
    public int updatePlatform(Integer platform, Integer id,String onePass) {
        return groupMapper.updatePlatform(platform,id,onePass);
    }

    @Override
    public List<Group> findUnAffiliatedList(String clientId) {
        return groupMapper.findUnAffiliatedList(clientId);
    }

    @Override
    public List<Group> findUnAffiliatedPage(String clientId, Integer pageIndex, Integer pageSize) {
        return groupMapper.findUnAffiliatedPage(clientId, pageIndex, pageSize);
    }

    @Override
    public int findUnAffiliatedCount(String clientId) {
        return groupMapper.findUnAffiliatedCount(clientId);
    }

    public List<Group> selectByOrg(String onePass) {
        return groupMapper.selectByOrg(onePass);
    }

    public List<Group> selectPageByOrg(String onePass, String groupName, Integer pageIndex, Integer pageSize) {
        return groupMapper.selectPageByOrg(onePass, groupName, pageIndex, pageSize);
    }

    public int selectCountByOrg(String onePass, String groupName) {
        return groupMapper.selectCountByOrg(onePass, groupName);
    }

    public List<Volunteer> selectVolPageById(Integer groupId, String groupName, Integer pageIndex, Integer pageSize) {
        return groupMapper.selectVolPageById(groupId, groupName, pageIndex, pageSize);
    }

    public int selectVolCountById(Integer groupId, String groupName) {
        return groupMapper.selectVolCountById(groupId, groupName);
    }
}
